package edu.sctu.practice.class02.xuqianlan.assign.assign03.Three;

import edu.sctu.practice.class02.xuqianlan.assign.assign03.Three.*;
import edu.sctu.practice.class02.xuqianlan.assign.assign03.Three.Circle;
import edu.sctu.practice.class02.xuqianlan.assign.assign03.Three.Name;

/**
 * Created by hj on 2015/11/5.
 */
public class CloneableCircle extends Circle implements Cloneable {
    private Name creator = new Name("Yong", "D", "Liang");

    public CloneableCircle(double radius) {
        super(radius);
    }

    public Name getCreator() {
        return creator;
    }

    public void setCreator(Name name) {
        creator = name;
    }

    public Object clone() {
        Object o = null;
        try {
            o = (edu.sctu.practice.class02.xuqianlan.assign.assign03.Three.CloneableCircle) super.clone();
        } catch (CloneNotSupportedException ex) {
            return null;
        }
        return o;
    }

    public String toString() {
        return super.toString() + "" + creator.getFullname();
    }
}
